/**
*@class Ir
*@brief class for access to ir device
*@author Boonen Louis
*@date 2011
*
* @section source Sources
* ir.cpp
* ir.h
* Iictool
* iicget
* iicset
* @section working What does the code
* this code gets the distance from the ADC over IIC
* and calculates the distance and orientation of an object
* @section destination Destination
*
* @sa Iictool
*
*/
#ifndef IR_H
#define IR_H

class Ir
{
public:
    /**
     * @brief Constructor
     *
     *
     */
	Ir();
    /** @brief Destructor
     */
	~Ir();

    /** @brief Measures the distance to an object
     *  ID value is '000' for sensor 1 and '001' for sensor 2
     * @return The distance
     *
     */
	int getDistance(int id);

	/** @brief Measures the orientation of an object
     *  uses getDistance for each sensor
     * @return The oriantation
     *
     */
	int getAngle();

private:
    /** @brief Uses the Iictool class to get IR sensor data
     *
     * @param id The identifier of the sensor '000' for sens1 '001' for sens2
     * @return distance
     *
     */
	int getSensorData(int id);
    /** @brief Setter of the distance_ variable
     *
     * @param d Distance
     *
     */
	void setDistance(int d);
    /** @brief Setter of the angle_ variable
     *
     * @param angle Orientation
     *
     */
    void setAngle(int angle);
    /** @brief calculate the distance from the ADC values
     *
     * @param afst ADC value
     *
     */
	int omrekenen(int afst);
	/**
	* distance variable
	*/
	int distance_;
	/**
	* angle variable
	*/
	int angle_;
};

#endif
